import { http } from '@/utils/http'
import type { BannerItem, CategoryItem, GuessItem, HotItem } from '@/types/home'
import type { PageParams, PageResult } from '@/types/global'
// 首页 公告区域展示位置轮播图
export const getHomeBannerAPI = (distributionSite = 1) => {
	return http<BannerItem[]>({
		url: '/home/banner',
		method: 'GET',
		data: {
			distributionSite
		}
	})
}

// 首页 分类模块
export const getHomeCategoryAPI = () => {
	return http<CategoryItem[]>({
		url: '/home/category/mutli',
		method: 'GET',
	})
}

// 首页 热门推荐
export const getHomeHotAPI = () => {
	return http<HotItem[]>({
		url: '/home/hot/mutli',
		method: 'GET',
	})
}

/**
 * 猜你喜欢-小程序
 */
export const getHomeGoodsGuessLikeAPI = (data?: PageParams) => {
	return http<PageResult<GuessItem>>({
		url: '/home/goods/guessLike',
		method: 'GET',
		data,
	})
}